package cn.openea.perpartner.system.enums;

import java.util.ArrayList;
import java.util.*;

public enum AppletsEnums {
    MEILY("meily", "wx5221ade9a28dd5f3", "5e3c5afb385567dc76012ad2d935ced5"),
    PERPARTNER("perpartner", "wxfe2e46a830dea1f6", "e2184a6a21dfcf3e14b3523127d447d7"),
    SEASTARSPACE("seastarspace", "wxc211cc5e61704cb1", "1566b28c2fdbb05284cc48f96f6b954a");
    private final String appletId;
    private final String appid;
    private final String secret;
    public String getAppletId() {
        return appletId;
    }
    public String getAppId() {
        return appid;
    }

    public String getSecret() {
        return secret;
    }

    AppletsEnums(String appletId, String appid, String secret) {
        this.appletId = appletId;
        this.appid = appid;
        this.secret = secret;
    }
    public static AppletsEnums getApplet(String appletId) {
        for (AppletsEnums applet : values()) {
            if (applet.appletId.equals(appletId)) {
                return applet;
            }
        }
        return AppletsEnums.MEILY;
    }
    public static List<String> getAppletIds() {
        List<String> appidList = new ArrayList<>();
        for (AppletsEnums applet : values()) {
            appidList.add(applet.appletId);
        }
        return appidList;
    }
}
